var reverse = function(x) {
  let y = x.toString().split("").reverse().join("");
  let res = ''
  if (y.indexOf('.') !== -1) {
    res = '-' + y.replace('-', '')
    return res
  } else if  (x < 0) {
    y = - y;
    return y > 2147483647 || y < -2147483648 ? 0 : y;
  } 
  };

  console.log(reverse(-123.233))